package moxl.relaxng.model;

import moxl.dom.DefaultQualifiedName;
import moxl.dom.DefaultXmlNamespace;
import moxl.dom.QualifiedName;
import moxl.dom.ethereal.EtherealElement;
import moxl.relaxng.schema.RelaxNgSchemaElementType;

public class ElementPattern extends PatternParentSupport
{
	public ElementPattern()
	{
		super(new EtherealElement(RelaxNgSchemaElementType.element.getName()));
	}

	public ElementPattern(QualifiedName name)
	{
		this();
		setName(name);
	}

	public ElementPattern(String name)
	{
		this();
		setName(name);
	}

	public void setName(String name)
	{
		setName(new DefaultQualifiedName(DefaultXmlNamespace.getInstance(), name));
	}

	public void setName(QualifiedName name)
	{
		getElement().setAttribute("name", name.getLocalPart());
	}

}
